<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_US">
<!--
 * Created on 2011-7-1
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
-->
<head>
<title></title>
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<style type="text/css">
	ul li{
		list-style: none;
	}
</style>
</head>
<body>
<ul class="scrollBox">
	<li>test_1</li>
	<li>test_2</li>
	<li>test_3</li>
	<li>test_3</li>
	<li>test_3</li>
	<li>test_3</li>
</ul>
<script type="text/javascript">
 	(function($) {  // 滚动插件代码
 	    $.fn.scroll = function(options) {
 	      options = options || {};
 	      this.css('overflow', 'hidden');
 	      var scroll = (function(self) {
 	        return function() {
 	          if (self.data('scroll_stop')) {
 	            return;
 	          }
 	          var li = self.find('li:first');
 	          var t = parseInt(li.css('marginTop')) || 0;
 	          li.animate({
 	            'marginTop': (t - li.outerHeight()) + 'px'
 	          }, options.speed || 'slow', function() {
 	            self.append(li);
 	            li.css('marginTop', t + 'px');
 	          });
 	        };
 	      })(this);
 	      setInterval(scroll, options.delay || 2000);
 	      this.hover(function() {
 	        $(this).data('scroll_stop', true);
 	      }, function() {
 	        $(this).removeData('scroll_stop');
 	      });
 	    };
 	  })(jQuery);
 	$(document).ready(function(){
 	    $('.scrollBox li:even').addClass('odd');
 	    $('.scrollBox:first').scroll();
 	  });
 	</script>
</body>
</html>
